home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / util / misc / amincp12.lha / AmigaNCP-1.2 / Docs / AmigaNCP.doc next >
Text File  |  1995-02-07  |  56KB  |  1,794 lines

  1.  
  2.  
  3. AmigaNCP
  4. ********
  5.  
  6. Welcome to the AmigaNCP package, the AmigaOS implementation of
  7. Psion's NCP network protocol.
  8.  
  9. Copyright
  10. *********
  11.  
  12. This is a registered release of the AmigaNCP package.  If you have any
  13. problems with or suggestions for this product, please contact us at:
  14.  
  15.      B&B Computersysteme
  16.      c/o Michael Balzer
  17.      Winchenbachstraße 12h
  18.      42281 Wuppertal
  19.      Germany
  20.  
  21. The AmigaNCP package has been written by
  22.  
  23.      Oliver Wagner
  24.      o.wagner@pluribus.wupper.de
  25.      Winchenbachstraße 12h
  26.      42281 Wuppertal
  27.      Germany
  28.  
  29. ...who does this job for a living with his wife, four kids and two
  30. cats...
  31.  
  32. The AmigaNCP driver library, the AmigaNCP File Server, the AmigaNCP
  33. File System, the AmigaNCP Documentation and all associated files are
  34. copyright (C) 1994 Oliver Wagner, All Rights Reserved.
  35.  
  36.     Psion, the Psion Logo, Psion Series 33-LinkPsion HC,
  37. Psion MCSSD and Solid State Disk are registered Trademarks of
  38. Psion PLC.
  39.  
  40.     Amiga, the Amiga logo and AmigaDOS are registered Trademarks of
  41. Commodore-Amiga, Inc.
  42.  
  43. The author wishes to thank the following people for their help during
  44. AmigaNCP development:
  45.  
  46. David Wood of Psion Ltd.
  47.      Who provided the necessary information about the NCP protocol and
  48.      helped with beta testing the package
  49.  
  50. Jeremy "Jezar" Wakefield of Psion Ltd.
  51.      Who helped to track down several hidden and esoteric bugs.
  52.  
  53. Michael Balzer
  54.      Who crossread and corrected this manual.
  55.  
  56. Sandro Paolini
  57.      For his overall help on AmigaNCP development and testing.
  58.  
  59. Introduction
  60. ************
  61.  
  62. Overview
  63. ========
  64.  
  65. Psion's fine palmtop computer series, namely the S3 and S3a,
  66. contain an even finer operating system, whose neat features cover a full
  67. fledged peer-to-peer networking software using a protocol called
  68. NCP.
  69.  
  70. Using NCP, you can link together two Psion computers or a Psion and a
  71. different, perhaps stationary machine and happily exchange data on your
  72. behalf.  NCP services include, but are not limited to, accessing files
  73. on the remote machines as if they were on yours, in both directions.
  74.  
  75. Linking your palmtop to your stationary machine is generally quite a
  76. good idea.  Doing so via the NCP protocol requires your stationary
  77. machine to have an implemention of this protocol.  There have only been
  78. implementations for MS-DOS clones (the MCLINK.EXE shell), for Apple
  79. MacIntosh and for Acorn Archimedes - until now.
  80.  
  81. AmigaNCP features a full NCP implementation including a remote file
  82. server to access Amiga files from your Psion and a file system to access
  83. Psion files from your Amiga.  The package also offers an API to allow
  84. custom applications to directly access network services at the NCP
  85. level.
  86.  
  87. Parts of AmigaNCP
  88. =================
  89.  
  90. AmigaNCP actually consists of several different programs.
  91.  
  92. The main part is the amigancp.library.  It contains the basic network
  93. services for exchanging data between two machines via a serial
  94. connection.  The protocol provides up to 8 data channels, which can be
  95. either passive (awaiting a connection from a client process) or active
  96. (attempting to connect to a server process).  One of the channels is
  97. reserved for the network supervisor application LINK.  The LINK
  98. functionality also has been integrated into amigancp.library.
  99.  
  100. Besides network I/O functions, the library also provides several
  101. utility functions to deal with Psion text format and the Intel byte
  102. ordering.
  103.  
  104. The AmigaNCP-FileServer is an application built on top of
  105. amigancp.library.  It provides a means of accessing AmigaDOS
  106. files from the remote Psion computer via the REM:: file system.  This
  107. allows you to access Amiga files just as if they were local Psion
  108. files.  With the Psion S3a, it allows you to use the Backup option to
  109. backup vital data files on your Amiga's harddisk.
  110.  
  111. The AmigaNCP-FileSystem uses the amigancp.library to connect to
  112. the file server running on your Psion in order to provide access to
  113. Psion files from the AmigaDOS environment.  It provides a new AmigaDOS
  114. device named NCP: which offers access to all available Psion devices.
  115. The Psion devices will be mounted as subdirectories in the NCP:
  116. window.
  117.  
  118. The AmigaNCP-Monitor monitors the activity of the NCP supervisor and
  119. gives detailed statistics about all channels.  This is an invaluable
  120. aid for debugging NCP applications.
  121.  
  122. The S3PrintServer allows you to print from your S3 or S3a directly to
  123. a printer connected to the Amiga.
  124.  
  125. The S3Run program remotely launches programs or applications on your
  126. Psion.
  127.  
  128. Using AmigaNCP
  129. **************
  130.  
  131. Installation
  132. ============
  133.  
  134. For using AmigaNCP you'll need...
  135.  
  136.   1. any Amiga equipped with OS 2.04 or better and a free serial port
  137.  
  138.   2. the IBM-PC version of the 3-Link serial cable
  139.  
  140.   3. and a Psion S3 or S3a (or any other model featuring Remote
  141.      Link)(1).
  142.  
  143.  
  144. To support Amiga systems without a hard disk, the AmigaNCP distribution
  145. has been organized to be ready-to-use.
  146.  
  147. Hard disk installation of AmigaNCP is best done using the provided
  148. Installer script.  The script will (by default) copy
  149. amigancp.library to LIBS:, put the language catalogs into
  150. LOCALE:Catalogs/ and create an AmigaNCP drawer on your work
  151. partition.  The drawer will contain the network services, documentation
  152. and the NCP tools.  There's an additional option for installing the
  153. amigancp.library developer material.
  154.  
  155. When installing the package for the first time, the installation
  156. procedure will ask you about the Psion model you're going to connect
  157. to.  The serial line speed will be set to the model's maximum (that is
  158. 9600 baud for the S3 or HC and 19200 baud for S3a or MC).
  159.  
  160. Configuring amigancp.library
  161. ============================
  162.  
  163. The default serial configuration is to use the serial.device, unit 0,
  164. at 9600 baud(2).
  165.  
  166. You can overwrite these default parameters by setting or changing the
  167. environment variable NCP.config.  The environment variable will be
  168. read by the amigancp.library each time a serial connection has to be
  169. established.
  170.  
  171. The parameter parsing is done just like in a shell command line; the
  172. template is D=DEVICE/K, U=UNIT/K/N, B=BAUD/K/N, NOREQ/S.  All
  173. parameters are optional, those not given will retain their default
  174. values.
  175.  
  176. An example:  To make AmigaNCP use duart.device, unit 1 at 19200 baud
  177. you have to set ENV:NCP.config to
  178.  
  179.     DEVICE=duart.device UNIT=1 BAUD=19200
  180.  
  181. The installation script will create both ENV:NCP.config and
  182. ENVARC:NCP.config with either
  183.  
  184.     DEVICE=serial.device UNIT=0 BAUD=9600
  185.  
  186. or
  187.  
  188.     DEVICE=serial.device UNIT=0 BAUD=19200
  189.  
  190. depending on your choice of Psion model.  Please note, that you may
  191. actually use any baud rate supported by the serial port in question
  192. (and of course supported by the other side's serial interface as well).
  193.  
  194. If you set the NOREQ switch, the library will not display any error
  195. requesters.
  196.  
  197. Note that you have to configure the remote site as well.  On the Psion
  198. S3 or S3a this consists of turning on NCP via the Remote Link menu of
  199. the system screen.  The baud rate must of course be set to the same
  200. value as used in ENV:NCP.config, or to 9600 if no configuration file
  201. exists.
  202.  
  203. Starting AmigaNCP
  204. =================
  205.  
  206. You don't start amigancp.library directly.  Instead you start one or
  207. more of the AmigaNCP applications, which in turn will open the library
  208. and try to establish their connections to the remote NCP site.
  209.  
  210. The library automatically terminates a connection about 10 seconds
  211. after the last application has closed its network channels.
  212.  
  213. Note that the underlying serial device is free to be used by any other
  214. application as long as no NCP connection is active and no connection
  215. attempt is made.
  216.  
  217. NCP Requesters
  218. ==============
  219.  
  220. The amigancp.library will put up error requesters if the network link
  221. breaks (and the NOREQ switch hasn't been set, see above).  The
  222. following table shows possible error conditions:
  223.  
  224. Can't open serial device
  225.      The device specified in ENV:NCP.config could not be opened.
  226.      Either the device does not exist (perhaps just because you
  227.      misspelled the device name) or it is in use by another process.
  228.  
  229. Timeout waiting for response
  230.      The serial device opened ok but the other side is not responding
  231.      to our handshake packet.  Most likey there is no Psion connected,
  232.      or it has it's Remote Link turned off.  This requester will
  233.      constantly show up if the AmigaNCP file system is running and the
  234.      serial link broke down.
  235.  
  236. Data not acknowledged
  237.      The last data packet has not been acknowledged.  This normally
  238.      denotes an NCP connection which has been interrupted during data
  239.      transfer.
  240.  
  241. Connection dropped
  242.      The remote side dropped the connection.
  243.  
  244. Argument error
  245.      Bad LLMAC request arguments.  You normally should not see this
  246.      error, it denotes an internal failure in the amigancp.library
  247.      high level I/O functions.
  248.  
  249. Not connected
  250.      There is no LLMAC connection.  You normally should not see this
  251.      error, it denotes an internal failure in the amigancp.library
  252.      high level I/O functions.
  253.  
  254. ---------- Footnotes ----------
  255.  
  256. (1)  In fact of course any NCP implementation does.  You can use
  257. AmigaNCP to connect to an NCP server running on an IBM PC or Apple Mac,
  258. or even to another AmigaNCP running on a different Amiga.
  259.  
  260. (2)  All other serial flags are fixed to 8N1, highspeed mode and 7-wire
  261. RTS/CTS handshake since this is required by the NCP protocol.
  262.  
  263. AmigaNCP File Server
  264. ********************
  265.  
  266. Introducing the File Server
  267. ===========================
  268.  
  269. The AmigaNCP File Server is an NCP application which provides access
  270. to Amiga files from the remote machine.  On startup it creates a
  271. passive NCP channel awaiting a connection from a remote file system.
  272.  
  273. On the S3 and S3a, the remote file system is built into the ROM.  It
  274. automatically attempts to connect to the remote file server when an NCP
  275. connection is made, and presents a new filesystem node named REM::,
  276. which in turn contains all the Amiga devices.  You can navigate through
  277. the Amiga devices via the system screen or directly access a file by
  278. it's full path name.
  279.  
  280. The Psion's file system was designed to be device independant, so there
  281. are no restrictions concerning the length of file names or extensions:
  282. The complete Amiga device, directory and file names are fully
  283. preserved.  However, directories are separated in the standard Psion
  284. manner via the \ character.
  285.  
  286. An example:  To access the Amiga file HD1:Test/Test.txt from the
  287. Psion, use the file name REM::HD1:\\TEST\\TEST.TXT.  To access
  288. SYS:S/Startup-Sequence, use REM::\\SYS:\\STARTUP-SEQUENCE.
  289.  
  290. When asked for a device list, the AmigaNCP File Server will output only
  291. real file system devices(1).  However, you may in fact access any
  292. AmigaDOS device, even volumes and assigned names, from the remote site
  293. by using the direct path to it.
  294.  
  295. An example:  To access the Amiga's parallel port from the remote site,
  296. just use the path REM::PAR:\\.  This is quite useful for using the
  297. print-to-file capabilities of some of the Psion applications.
  298.  
  299. Character conversion mode
  300. =========================
  301.  
  302. Since the Psion's operating system uses a different character codeset
  303. than the Amiga does, you normally can't easily exchange ASCII files
  304. between the two machines.  The AmigaNCP File Server however provides a
  305. special conversion mode which allows to convert files on the fly.
  306.  
  307. Whenever you add the special extension .CV to any remote file name,
  308. all characters read from or written to that file will
  309. automatically be converted by AmigaNCP.  The conversion is fully
  310. transparent to your applications.
  311.  
  312. An example:  To edit the Amiga text file HD1:Test/Test.TXT on the S3
  313. with automatic character conversion, use the virtual file name
  314. REM::HD1:\\TEST\\TEST.TXT.CV.
  315.  
  316. Note that character conversion mode should be used only for text
  317. files.  The S3 and S3a Word file format for example contains binary
  318. data which will be gracefully mangled if accessed in conversion mode.
  319.  
  320. File Server Options
  321. ===================
  322.  
  323. The AmigaNCP File Server may be started either from the shell or from
  324. Workbench.  To terminate the server, just start it again, it will put
  325. up a requester showing you the number of files in use and asking you
  326. whether you really want to quit.
  327.  
  328. The File Server accepts several options to modify the way it operates.
  329. Note that you have to set up amigancp.library first (See Using
  330. AmigaNCP.).
  331.  
  332. Options may be given on the command line (shell) or using tooltype
  333. entries (Workbench).  You may use project icons to start the File
  334. Server in order to have different configurations at hand.
  335.  
  336. The option template is:
  337.          IBM=CHARSETCONV/S,
  338.      SHOWICONS=SHOWINFO/S,
  339.      HIDEEMPTYDRIVES/S,
  340.      BUFFER=BUFFERSIZE
  341. You may enter ? to get additional help at the command line.  Detailed
  342. parameter descriptions follow.
  343.  
  344. CharSetConv
  345. -----------
  346.  
  347. When the remote file system requests a directory scan, the file server
  348. examines each file to determine whether it is a text file or not(2).
  349. Text files are then returned both with their normal name and with the
  350. magic extension .CV added.
  351.  
  352. ShowInfo
  353. --------
  354.  
  355. Show *.info and .backdrop files during a directory scan.  You
  356. normally shouldn't set this option, the Psion has no use for these
  357. files and directory scans are much faster without them.
  358.  
  359. Please note that the Psion's Delete Whole Directory function will
  360. only work correctly on Amiga directories if ShowInfo has been enabled.
  361.  
  362. HideEmptyDrives
  363. ---------------
  364.  
  365. Upon a device list query, don't return drives which currently do not
  366. contain a medium.  This option is intended mainly to overcome an
  367. annoying quirk in the S3 and S3a system screen which resets the current
  368. device to LOC::\\M\\ each time a device reports E_NOT_READY.  This
  369. normally always happens when getting to REM::DF0: with no disk in the
  370. drive.
  371.  
  372. Note that, although these devices are not visible in the device list,
  373. they may as usual be accessed by manually entering the device name.
  374.  
  375. BufferSize
  376. ----------
  377.  
  378. Set the size of the filehandle buffers used by the File Server.  This
  379. parameter defaults to 4096 Bytes and normally doesn't need to be
  380. changed(3).
  381.  
  382. ---------- Footnotes ----------
  383.  
  384. (1)  Tech info:  Any device which responds positively to
  385. ACTION_IS_FILESYSTEM is considered to be a real file system.
  386.  
  387. (2)  Tech info:  This is done by reading the first 512 Bytes and
  388. scanning them for non-printable characters.  Files with the S
  389. protection bit set are always assumed to be text files.
  390.  
  391. (3)  This option has no effect on AmigaOS below version 3.1
  392.  
  393. AmigaNCP File System
  394. ********************
  395.  
  396. Introducing the File System
  397. ===========================
  398.  
  399. The AmigaNCP File System is an NCP application which provides access
  400. from the AmigaDOS environment to files on the remote machine.  It
  401. creates a new AmigaDOS device named NCP:, which in turn contains all
  402. remote devices as subdirectories.
  403.  
  404. The Amiga directory NCP:A refers to the device A: on the remote
  405. side, NCP:M refers to M: and so on.
  406.  
  407. If you want to access any file on the remote device, just add the full
  408. path name.  To access the file A:\\WRD\\SECRET.WRD, just use the
  409. Amiga file name NCP:A/WRD/SECRET.WRD.
  410.  
  411. You can access the new device from any Amiga application, including
  412. Workbench and your favourite directory tool, as if they were standard
  413. Amiga files.
  414.  
  415. On startup, the AmigaNCP File System immediately attempts to connect to
  416. the File Server on the remote machine.  If no connection can be made,
  417. the File System will refuse to start.  You may attempt to quit it at
  418. any time by starting it again, however, due to AmigaDOS constraints it
  419. will refuse to quit if there are any files or locks still in use.
  420.  
  421. Character Conversion Mode
  422. =========================
  423.  
  424. The AmigaNCP File System also features the character conversion mode.
  425. If you enable this option, all remote devices will be mirrored as
  426. CONV_<devname>, and all characters read from or written to files
  427. within these subdirectories will automatically be converted.
  428.  
  429. Example:  To access A:\\WRD\\SECRET.TXT with character conversion,
  430. use the file name NCP:CONV_A/WRD/SECRET.TXT.
  431.  
  432. The translation is fully transparent; you may, for example, use your
  433. favourite text editor to load a text file from the Psion, edit it and
  434. save it again.  Upon reading, it will be converted to the Amiga ISO
  435. character set, upon writing, it will be converted back to the IBM codes
  436. used by the Psion.
  437.  
  438. File System Options
  439. ===================
  440.  
  441. The File System accepts several options to modify the way it operates.
  442. Note that you have to set up amigancp.library first (See Using
  443. AmigaNCP.).
  444.  
  445. Upon shell startup, options are specified on the command line.  The
  446. template is:
  447.          VOL=VOLUMENAME/K,
  448.      DEV=DEVICENAME/K,
  449.      SR=SHAREDREAD/S,
  450.      IBM=CHARSETCONV/S,
  451.      HED=HIDEEMPTYDRIVES/S,
  452.      DWMS=DONTWARNMISSINGSERVER/S,
  453.      ARR=AUTOREREAD/S
  454. You may enter ? to get additional help at the command line.  See
  455. below for detailed descriptions of these parameters.
  456.  
  457. If started from Workbench, the File System application will read its
  458. icon and parse the tooltypes for the same option keywords.  You may use
  459. project icons for starting the File System in order to have different
  460. configurations at hand.
  461.  
  462. VolumeName
  463. ----------
  464.  
  465. This options allows you to set the volume node name of the File System.
  466. Defaults to AmigaNCP-Remote.  This is the name the Workbench shows
  467. below the disk icon.
  468.  
  469. DeviceName
  470. ----------
  471.  
  472. Modifies the device name of the File System.  Defaults to NCP:.
  473.  
  474. SharedRead
  475. ----------
  476.  
  477. For historical reasons, there is no real read only mode in the
  478. AmigaDOS.  The access mode MODE_OLDFILE can be used for reading and
  479. writing an existing file from multiple accessors.  So an Amiga file
  480. system cannot predict whether a file opened with MODE_OLDFILE will
  481. also be written to.
  482.  
  483. The Psion filing system however limits multiple file access to read
  484. only mode.
  485.  
  486. To be as compatible as possible with existing Amiga applications, the
  487. AmigaNCP File System by default translates MODE_OLDFILE to exclusive
  488. read/write access on the Psion.
  489.  
  490. This may cause problems if a file is already opened for reading from
  491. the Psion side, perhaps because you have a Psion application running
  492. which accesses this file.  Even a read only access from the Amiga side
  493. will fail because it translates to a read/write access on the Psion
  494. side.
  495.  
  496. In order to overcome this AmigaDOS quirk, the AmigaNCP File System
  497. provides this option to translate MODE_OLDFILE to a shared read
  498. access on the Psion side.  Every write attempt on such a file will
  499. result in a ERROR_WRITE_PROTECTED.
  500.  
  501. CharSetConv
  502. -----------
  503.  
  504. Activate character conversion mode.  All Psion devices are mirrored as
  505. CONV_<devname and read/write accesses to files within these drawers
  506. are silently translated.
  507.  
  508. Note that file handles opened in character conversion mode don't
  509. support ACTION_SEEK.  This may cause problems with some applications.
  510.  
  511. HideEmptyDrives
  512. ---------------
  513.  
  514. Don't create subdirectories for Psion devices which don't contain a
  515. medium.
  516.  
  517. DontWarnMissingServer
  518. ---------------------
  519.  
  520. The File Server should normally be started first, because the Psion
  521. LINK application attempts to contact it as soon as the connection has
  522. been established, and it will not try again if no connection could be
  523. made.
  524.  
  525. Therefore, the File System will warn you with a requester if it can't
  526. detect the AmigaNCP File Server when it is started.  Setting this option
  527. instructs the File System not to do so.
  528.  
  529. AutoReRead
  530. ----------
  531.  
  532. By default, the File System reads the remote device list only once at
  533. the time it is started.
  534.  
  535. This should normally be no problem, unless you use HideEmptyDrives
  536. and replace SSD cartridges while a connection is active.
  537.  
  538. You can use DiskChange NCP: at any time to manually force the File
  539. System to read the device list again.  Or you can set AutoReRead,
  540. which causes the File System to read the device list from the remote
  541. side upon every access, which of course will slow accesses down a bit.
  542.  
  543. Implementation Details
  544. ======================
  545.  
  546. The AmigaNCP File System supports the following AmigaDOS packet types:
  547.  
  548.    * ACTION_IS_FILESYSTEM
  549.  
  550.    * ACTION_FLUSH
  551.  
  552.    * ACTION_DISK_INFO
  553.  
  554.    * ACTION_INFO
  555.  
  556.    * ACTION_COPY_DIR
  557.  
  558.    * ACTION_COPY_DIR_FH
  559.  
  560.    * ACTION_LOCATE_OBJECT
  561.  
  562.    * ACTION_FREE_LOCK
  563.  
  564.    * ACTION_EXAMINE_FH
  565.  
  566.    * ACTION_EXAMINE_OBJECT
  567.  
  568.    * ACTION_EXAMINE_NEXT
  569.  
  570.    * ACTION_CURRENT_VOLUME
  571.  
  572.    * ACTION_SAME_LOCK
  573.  
  574.    * ACTION_CREATE_DIR
  575.  
  576.    * ACTION_PARENT
  577.  
  578.    * ACTION_PARENT_FH
  579.  
  580.    * ACTION_DELETE_OBJECT
  581.  
  582.    * ACTION_RENAME_OBJECT
  583.  
  584.    * ACTION_DIE
  585.  
  586.    * ACTION_FINDINPUT
  587.  
  588.    * ACTION_FINDOUTPUT
  589.  
  590.    * ACTION_FINDUPDATE
  591.  
  592.    * ACTION_INHIBIT
  593.  
  594.    * ACTION_END
  595.  
  596.    * ACTION_READ
  597.  
  598.    * ACTION_WRITE
  599.  
  600.    * ACTION_SEEK
  601.  
  602.    * ACTION_SET_PROTECT
  603.  
  604.    * ACTION_SET_DATE
  605.  
  606. Other Tools
  607. ***********
  608.  
  609. The AmigaNCP package contains a few more programs which are meant for
  610. the advanced user.  Since they are also good examples for how to access
  611. the amigancp.library, the source code for most of these utilities can
  612. be found in the Developer/Source/ drawer.
  613.  
  614. AmigaNCP-Monitor
  615. ================
  616.  
  617. The AmigaNCP-Monitor is a utility for monitoring the current network
  618. activity.  It displays an overview over the eight avaible NCP channels,
  619. their users, current connection states and the amount of data that has
  620. been transferred.
  621.  
  622.     AmigaNCP-Monitor may be started either from the shell or from
  623. Workbench.  There are no additional parameters.  The window position
  624. will be saved as a tooltype entry.
  625.  
  626. The Monitor opens a single window on the workbench screen.  The top
  627. part displays the states of the eight network channels, the bottom part
  628. shows overall statistics and whether NCP is currently connected.
  629.  
  630. ThisProc
  631.      The network name of the Amiga process using the channel.  The
  632.      first channel is always allocated by the LINK application.
  633.  
  634. RemotePr
  635.      The name of the remote process.  This may be empty, meaning the
  636.      channel is currently not connected.
  637.  
  638.          UnknClnt identifies a passive channel connected to an
  639.      unknown client.
  640.  
  641.      For the first channel, this may be either ARemLink, denoting
  642.      that the current connection has been initiated by the remote link,
  643.      or PRemLink, if the current connection was opened on behalf of
  644.      the amigancp.library.
  645.  
  646. Status
  647.      This flag array denotes various internal states of
  648.      amigancp.library.
  649.  
  650. Bytes Sent
  651.      How many bytes have been sent through this channel?
  652.  
  653. Bytes Received
  654.      How many bytes have been received through this channel?
  655.  
  656. Online since
  657.      The time on which amigancp.library was started first.  The
  658.      startup time is used by the NCP protocol to determine whether a
  659.      broken connection can be reestablished or not.
  660.  
  661. Remote NCP
  662.      The remote NCP's startup time.
  663.  
  664. Version
  665.      The remote NCP's version.  This is generally 2 for AmigaNCP and
  666.      the Psion S3 and 3 for the S3a.
  667.  
  668. Connected
  669.      This will be displayed whenever there is an active connection to
  670.      any remote NCP.
  671.  
  672. S3PrintServer
  673. =============
  674.  
  675. The S3PrintServer is a small utility which allows you to print from
  676. your Psion directly to a printer connected to the Amiga.  It uses the
  677. Psion's capability to print to a serial printer, and simply passes any
  678. data from the serial port directly to the printer device via raw writes.
  679.  
  680. You have to turn off the Remote Link on the Psion side and terminate
  681. any NCP application running on the Amiga side before starting the
  682. S3PrintServer.  If you forget to turn off the Remote Link, junk will
  683. be printed due to misinterpreted NCP packets!
  684.  
  685. You must also set your Psion's printer configuration to serial
  686. printing, with the same baud rate used for NCP connections, turn off
  687. Xon/Xoff and turn on RTS/CTS and DSR/DTR handshaking.  The
  688. S3PrintServer itself reads the serial configuration from the file
  689. ENV:NCP.config.
  690.  
  691. The S3PrintServer uses the raw write capabilities of the
  692. printer.device and therefore ignores any printer driver settings.
  693. However, it respects your choice on which device to print, and even
  694. allows printing via network printer services, e.g.  Envoy Network
  695. Printing.
  696.  
  697. Therefore, you must select the correct WDR printer driver on the
  698. Psion.  This can be done in the Printer Setup dialog of the
  699. Word application.
  700.  
  701. Having done all this, you can print from your Psion applications simply
  702. by selecting the Print... menu, just as if the printer was connected
  703. directly to the Psion.
  704.  
  705. S3Run
  706. =====
  707.  
  708. The S3Run utility uses the LINK application's capability to launch
  709. a process on the remote side.  It's a shell only program which takes
  710. one or two parameters: S3Run filename commandline
  711.  
  712. The first argument denotes the file name of the remote program to run,
  713. for example TEST.IMG.  Due to NCP restrictions, this may only be a
  714. program on the Psion's top level directory or ROM.
  715.  
  716. The second argument may contain the command line to be passed to the
  717. created process.  This argument may be omitted, in which case no command
  718. line will be passed.
  719.  
  720. You may use \\xx escaping to insert the hexadecimal code xx into
  721. the command line.  See `the Psion SIBO SDK Manual' for more information
  722. on S3 command lines.
  723.  
  724. API
  725. ***
  726.  
  727. This part of the AmigaNCP documentation describes the use of AmigaNCP
  728. services within custom applications.  It assumes a broad knowledge of
  729. programming AmigaOS.
  730.  
  731. NCP Implementation
  732. ==================
  733.  
  734. The Psion NCP network protocol consists of four layers:
  735.  
  736. Serial Layer
  737.      A simple asynchronous serial 8/N/1 connection.  This is in fact
  738.      the hardware serial connection built into the 3-Link.
  739.  
  740. Packet Layer
  741.      A packet protocol providing checksums and multiple
  742.      retransmissions.  It is called LLMAC and somewhat based on the
  743.      MNP type protocols.
  744.  
  745. NCP Layer
  746.      NCP provides up to eight independant data streams between local
  747.      and remote processes.  Under the Psion OS, a process may use only
  748.      one NCP channel at a time.
  749.  
  750. Application Layer
  751.      Applications built on top of the NCP data stream service.  This
  752.      includes the remote file system and remote file server.  There is
  753.      also a supervisory application called LINK which controls the
  754.      server setup.
  755.  
  756. A more detailed description of NCP usage from the Psion side can be
  757. found in the `Psion SIBO SDK Manual, I/O Devices Reference'.
  758.  
  759. On the Amiga side, the serial layer is provided through any standard
  760. EXEC serial device, normally this will be the internal port's
  761. serial.device.  The packet and NCP layers have been built into
  762. the amigancp.library.
  763.  
  764. Besides these basic layers, also the supervisory LINK application
  765. resides in the
  766.     amigancp.library.
  767.  
  768. All network services are accessible via function calls to the
  769. amigancp.library.  In order to use these functions, you have to
  770. open the amigancp.library first:
  771.  
  772.          #include <libraries/ncp.h>
  773.      
  774.          struct Library *NCPBase;
  775.          NCPBase = OpenLibrary( "amigancp.library", NCP_VERSION );
  776.          if( !NCPBase )
  777.              fail_app();
  778.  
  779. If you use SAS/C 6.50 or above, you may want to use the link library
  780. ncp.lib provided in the development toolkit.  It contains a
  781. constructor/destructor pair that automatically opens/closes the
  782. amigancp.library upon startup/termination of your application.
  783.  
  784. If you are not using C, you'll have to build your own language specific
  785. glue definitions.  A function description file
  786. (Developer/FD/ncp_lib.fd) has been included.  The AmigaNCP
  787. programming interface doesn't use any fancy data structures, so you
  788. should have no problems with other programming languages.
  789.  
  790. The NCP network services are based on channels.  A channel is a
  791. connection between a local and a remote processes.  In the Psion EPOC
  792. environment, a channel is bound to a single process and bears the name
  793. of that process.  AmigaNCP allows you to specify arbitrary names for
  794. your channels, along with having multiple channels within a single
  795. application, if you wish to do so.
  796.  
  797. A channel may be opened in either active or passive mode.  An
  798. active channel attempts to connect to a remote process with a given name
  799. and refuses to open if the remote process doesn't exists or already is
  800. busy with some other connection.  A passive channel just sits around
  801. awaiting a connection from the remote site.  Passive channels are
  802. normally used for server applications awaiting connections from their
  803. clients, whereas active channels are used by clients to contact their
  804. server application.
  805.  
  806. I/O via NCP is done either synchronously or asynchronously.  The
  807. I/O interface of the amigancp.library is quite similar to the EXEC
  808. device I/O interface.  See the function descriptions of the NCP I/O
  809. functions for more details.
  810.  
  811. The Developer/Source/ drawer provides some examples to show the use
  812. of the
  813.     amigancp.library calls.
  814.  
  815. Function Reference
  816. ==================
  817.  
  818. Note that this function reference is also available in standard Amiga
  819. Autodoc format (Developer/Autodocs/ncp.doc).
  820.  
  821. NCP_CloseChannel
  822. ----------------
  823.  
  824.         NAME
  825.          NCP_CloseChannel -- close an NCP channel
  826.      
  827.         SYNOPSIS
  828.          NCP_CloseChannel( channel )
  829.                             A0
  830.      
  831.         void NCP_CloseChannel( APTR );
  832.      
  833.         FUNCTION
  834.          Close a NCP channel previously opened by NCP_OpenChannel().
  835.          If this is an active link to the remote machine, it will be
  836.          closed.
  837.      
  838.         INPUTS
  839.          channel -- channel to close. May be NULL, in which case
  840.                     this functions does nothing.
  841.      
  842.         RESULT
  843.          None.
  844.      
  845.         EXAMPLE
  846.      
  847.         NOTES
  848.          An active NCP connection will be dropped about 10s
  849.          after the last channel has been closed.
  850.      
  851.         BUGS
  852.          None known.
  853.      
  854.         SEE ALSO
  855.          NCP_OpenChannel()
  856.  
  857. NCP_OpenChannel
  858. ---------------
  859.  
  860.         NAME
  861.          NCP_OpenChannel -- open an NCP channel to attempt to connect to
  862.                            the remote.
  863.      
  864.         SYNOPSIS
  865.          channel = NCP_OpenChannel( localname, remotename, flags )
  866.            D0                          A0          A1        D0
  867.      
  868.          APTR NCP_OpenChannel( STRPTR, STRPTR, ULONG );
  869.      
  870.         FUNCTION
  871.          Opens an NCP channel. If remotename is not NULL, attempts
  872.          to connect to the remote process and fails with a NULL
  873.          return if the connection could not be made. If remotename
  874.          is NULL, creates a passive channel silently awaiting remote
  875.          connection.
  876.      
  877.         INPUTS
  878.          localname -- name of local "process"
  879.          remotename -- either NULL for a passive channel or
  880.                        the remote process name which to connect
  881.                        to
  882.          flags -- currently unused, leave at 0
  883.      
  884.         RESULT
  885.          channel -- pointer to a channel object. NULL in case of
  886.                     an error, whereas additional error information
  887.                     can be found in IoErr()
  888.      
  889.         EXAMPLE
  890.          To connect to the remote file server:
  891.      
  892.             APTR channel;
  893.             channel = NCP_OpenChannel( "TestHost", "SYS$RFSV.*", 0 );
  894.      
  895.      
  896.         NOTES
  897.          Opening an active channel will result in an attempt to
  898.          create an NCP connection and fail upon any error (including
  899.          serial failure or inexistance of the remote process).
  900.          Creating an passive channel will not cause an NCP connection
  901.          attempt; this is done upon the first I/O request made to
  902.          channel.
  903.      
  904.         BUGS
  905.          None known.
  906.      
  907.         SEE ALSO
  908.          NCP_CloseChannel()
  909.  
  910. NCP_Read
  911. --------
  912.  
  913.         NAME
  914.          NCP_Read -- do a read request.
  915.      
  916.         SYNOPSIS
  917.          status = NCP_Read( channel, data, datasize )
  918.            D0                     A0
  919.      
  920.          LONG NCP_Read( APTR, APTR, ULONG );
  921.      
  922.         FUNCTION
  923.          This is basically identical to calling NCP_BeginRead()
  924.          followed by NCP_WaitRead().
  925.      
  926.         INPUTS
  927.          channel -- a NCP channel created by NCP_OpenChannel()
  928.          data -- receive buffer
  929.          datasize -- receive buffer size
  930.      
  931.         RESULT
  932.          status -- number of bytes read or a negative error
  933.                    number.
  934.      
  935.         EXAMPLE
  936.      
  937.         NOTES
  938.      
  939.         BUGS
  940.      
  941.         SEE ALSO
  942.          NCP_WaitRead(), NCP_BeginRead(), NCP_AbortRead(), NCP_CheckRead()
  943.  
  944. NCP_BeginRead
  945. -------------
  946.  
  947.         NAME
  948.          NCP_BeginRead -- start a read request on the NCP channel.
  949.      
  950.         SYNOPSIS
  951.          error = NCP_BeginRead( channel, data, datasize )
  952.            D0                     A0      A1       D0
  953.      
  954.          LONG NCP_BeginRead( APTR, APTR, ULON G);
  955.      
  956.         FUNCTION
  957.          Queues a read operation on the current NCP channel.
  958.      
  959.         INPUTS
  960.          channel -- a NCP channel created by NCP_OpenChannel()
  961.          data -- receive buffer
  962.          datasize -- receive buffer size
  963.      
  964.         RESULT
  965.          error -- either 0 if the read was queued successfully
  966.                   or a negative error number
  967.      
  968.         EXAMPLE
  969.      
  970.         NOTES
  971.          Only one read request may be queued at a time on a single
  972.          channel. This function fails with NCPE_INUSE if there is
  973.          already a read request outstanding.
  974.      
  975.         BUGS
  976.          None known.
  977.      
  978.         SEE ALSO
  979.          NCP_Read(), NCP_WaitRead(), NCP_AbortRead(), NCP_CheckRead()
  980.  
  981. NCP_AbortRead
  982. -------------
  983.  
  984.         NAME
  985.          NCP_AbortRead -- abort read currently in progress
  986.      
  987.         SYNOPSIS
  988.          NCP_AbortRead( channel )
  989.                           A0
  990.      
  991.          void NCP_AbortRead( APTR )
  992.      
  993.         FUNCTION
  994.          Aborts the current read request on the given NCP channel.
  995.          Does nothing if no read is pending.
  996.      
  997.         INPUTS
  998.          channel -- a NCP channel created by NCP_OpenChannel()
  999.      
  1000.         RESULT
  1001.          None.
  1002.      
  1003.         EXAMPLE
  1004.      
  1005.         NOTES
  1006.          Never forget to finish a read request using NCP_WaitRead(),
  1007.          or you'll end up in OS hell.
  1008.      
  1009.         BUGS
  1010.          None known.
  1011.      
  1012.         SEE ALSO
  1013.          NCP_Read(), NCP_WaitRead(), NCP_CheckRead(), NCP_BeginRead()
  1014.  
  1015. NCP_CheckRead
  1016. -------------
  1017.  
  1018.         NAME
  1019.          NCP_CheckRead -- check if a read request is still pending
  1020.      
  1021.         SYNOPSIS
  1022.          status = NCP_CheckRead( channel )
  1023.            D0                       A0
  1024.      
  1025.          LONG NCP_CheckRead( APTR )
  1026.      
  1027.         FUNCTION
  1028.          Check if a read request is still pending on the given NCP
  1029.          channel.
  1030.      
  1031.         INPUTS
  1032.          channel -- a NCP channel created by NCP_OpenChannel()
  1033.      
  1034.         RESULT
  1035.          status -- FALSE if a read is currently pending,
  1036.                    TRUE if no request is pending or the current
  1037.                    request has completed.
  1038.      
  1039.         EXAMPLE
  1040.      
  1041.         NOTES
  1042.          Never forget to finish a read request using NCP_WaitRead(),
  1043.          or you'll end up in OS hell.
  1044.      
  1045.         BUGS
  1046.          None known.
  1047.      
  1048.         SEE ALSO
  1049.          NCP_Read(), NCP_WaitRead(), NCP_AbortRead(), NCP_BeginRead()
  1050.  
  1051. NCP_WaitRead
  1052. ------------
  1053.  
  1054.         NAME
  1055.          NCP_WaitRead -- complete a read request on the NCP channel.
  1056.      
  1057.         SYNOPSIS
  1058.          result = NCP_WaitRead( channel )
  1059.            D0                     A0
  1060.      
  1061.          LONG NCP_WaitRead( APTR );
  1062.      
  1063.         FUNCTION
  1064.          Waits for the current read request to finish and
  1065.          returns the result.
  1066.      
  1067.         INPUTS
  1068.          channel -- a NCP channel created by NCP_OpenChannel()
  1069.      
  1070.         RESULT
  1071.          status -- number of bytes read or a negative error
  1072.                    number.
  1073.      
  1074.         EXAMPLE
  1075.      
  1076.         NOTES
  1077.          Every read request startet with NCP_BeginRead() absolutely
  1078.          must be followed by a NCP_WaitRead(), even if it already
  1079.          finished or was aborted via NCP_AbortRead().
  1080.      
  1081.         BUGS
  1082.          Calling this function without an queued read request
  1083.          will hang up your process.
  1084.      
  1085.         SEE ALSO
  1086.          NCP_Read(), NCP_BeginRead(), NCP_AbortRead(), NCP_CheckRead()
  1087.  
  1088. NCP_ReadSig
  1089. -----------
  1090.  
  1091.         NAME
  1092.          NCP_ReadSig -- return signal mask of channel read port.
  1093.      
  1094.         SYNOPSIS
  1095.          sigmask = NCP_ReadSig( channel )
  1096.            D0                     A0
  1097.      
  1098.          ULONG NCP_ReadSig( APTR );
  1099.      
  1100.         FUNCTION
  1101.          This function returns the signal mask of the read port
  1102.          of the given NCP channel. This signal is set if a read
  1103.          request completes.
  1104.      
  1105.         INPUTS
  1106.          channel -- a NCP channel created by NCP_OpenChannel()
  1107.      
  1108.         RESULT
  1109.          sigmask -- signal mask of read port.
  1110.      
  1111.         EXAMPLE
  1112.      
  1113.         NOTES
  1114.          Note that this function returns a signal mask, not a signal bit number.
  1115.      
  1116.         BUGS
  1117.      
  1118.         SEE ALSO
  1119.          NCP_BeginRead()
  1120.  
  1121. NCP_Write
  1122. ---------
  1123.  
  1124.         NAME
  1125.          NCP_Write -- do a write request.
  1126.      
  1127.         SYNOPSIS
  1128.          status = NCP_Write( channel, data, datasize )
  1129.            D0                   A0     A1      D0
  1130.      
  1131.          LONG NCP_Write( APTR, APTR, ULONG );
  1132.      
  1133.         FUNCTION
  1134.          This is basically identical to calling NCP_BeginWrite()
  1135.          followed by NCP_WaitWrite().
  1136.      
  1137.         INPUTS
  1138.          channel -- a NCP channel created by NCP_OpenChannel()
  1139.          data -- receive buffer
  1140.          datasize -- receive buffer size
  1141.      
  1142.         RESULT
  1143.          status -- number of bytes written or a negative error
  1144.                    number.
  1145.      
  1146.         EXAMPLE
  1147.      
  1148.         NOTES
  1149.      
  1150.         BUGS
  1151.      
  1152.         SEE ALSO
  1153.          NCP_WaitWrite(), NCP_BeginWrite(), NCP_AbortWrite(), NCP_CheckWrite()
  1154.  
  1155. NCP_BeginWrite
  1156. --------------
  1157.  
  1158.         NAME
  1159.          NCP_BeginWrite -- start a write request on the NCP channel.
  1160.      
  1161.         SYNOPSIS
  1162.          error = NCP_BeginWrite( channel, data, datasize )
  1163.            D0                     A0      A1       D0
  1164.      
  1165.          LONG NCP_BeginWrite( APTR, APTR, ULON G);
  1166.      
  1167.         FUNCTION
  1168.          Queues a write operation on the current NCP channel.
  1169.      
  1170.         INPUTS
  1171.          channel -- a NCP channel created by NCP_OpenChannel()
  1172.          data -- data buffer
  1173.          datasize -- data buffer size
  1174.      
  1175.         RESULT
  1176.          error -- either 0 if the write was queued successfully
  1177.                   or a negative error number
  1178.      
  1179.         EXAMPLE
  1180.      
  1181.         NOTES
  1182.          Only one write request may be queued at a time on a single
  1183.          channel. This function fails with NCPE_INUSE if there is
  1184.          already a write request outstanding.
  1185.      
  1186.         BUGS
  1187.          None known.
  1188.      
  1189.         SEE ALSO
  1190.          NCP_Write(), NCP_WaitWrite(), NCP_AbortWrite(), NCP_CheckWrite()
  1191.  
  1192. NCP_AbortWrite
  1193. --------------
  1194.  
  1195.         NAME
  1196.          NCP_AbortWrite -- abort write currently in progress
  1197.      
  1198.         SYNOPSIS
  1199.          NCP_AbortWrite( channel )
  1200.                           A0
  1201.      
  1202.          void NCP_AbortWrite( APTR )
  1203.      
  1204.         FUNCTION
  1205.          Aborts the current write request on the given NCP channel.
  1206.          Does nothing if no write is pending.
  1207.      
  1208.         INPUTS
  1209.          channel -- a NCP channel created by NCP_OpenChannel()
  1210.      
  1211.         RESULT
  1212.          None.
  1213.      
  1214.         EXAMPLE
  1215.      
  1216.         NOTES
  1217.          Never forget to finish a write request using NCP_WaitWrite(),
  1218.          or you'll end up in OS hell.
  1219.      
  1220.         BUGS
  1221.          None known.
  1222.      
  1223.         SEE ALSO
  1224.          NCP_Write(), NCP_WaitWrite(), NCP_CheckWrite(), NCP_BeginWrite()
  1225.  
  1226. NCP_CheckWrite
  1227. --------------
  1228.  
  1229.         NAME
  1230.          NCP_CheckWrite -- check if a write request is still pending
  1231.      
  1232.         SYNOPSIS
  1233.          status = NCP_CheckWrite( channel )
  1234.            D0                       A0
  1235.      
  1236.          LONG NCP_CheckWrite( APTR )
  1237.      
  1238.         FUNCTION
  1239.          Check if a write request is still pending on the given NCP
  1240.          channel.
  1241.      
  1242.         INPUTS
  1243.          channel -- a NCP channel created by NCP_OpenChannel()
  1244.      
  1245.         RESULT
  1246.          status -- FALSE if a write is currently pending,
  1247.                    TRUE if no request is pending or the current
  1248.                    request has completed.
  1249.      
  1250.         EXAMPLE
  1251.      
  1252.         NOTES
  1253.          Never forget to finish a write request using NCP_WaitWrite(),
  1254.          or you'll end up in OS hell.
  1255.      
  1256.         BUGS
  1257.          None known.
  1258.      
  1259.         SEE ALSO
  1260.          NCP_Write(), NCP_WaitWrite(), NCP_AbortWrite(), NCP_BeginWrite()
  1261.  
  1262. NCP_WaitWrite
  1263. -------------
  1264.  
  1265.         NAME
  1266.          NCP_WaitWrite -- complete a write request on the NCP channel.
  1267.      
  1268.         SYNOPSIS
  1269.          result = NCP_WaitWrite( channel )
  1270.            D0                     A0
  1271.      
  1272.          LONG NCP_WaitWrite( APTR );
  1273.      
  1274.         FUNCTION
  1275.          Waits for the current write request to finish and
  1276.          returns the result.
  1277.      
  1278.         INPUTS
  1279.          channel -- a NCP channel created by NCP_OpenChannel()
  1280.      
  1281.         RESULT
  1282.          status -- number of bytes written or a negative error
  1283.                    number.
  1284.      
  1285.         EXAMPLE
  1286.      
  1287.         NOTES
  1288.          Every write request startet with NCP_BeginWrite() absolutely
  1289.          must be followed by a NCP_WaitWrite(), even if it already
  1290.          finished or was aborted via NCP_AbortWrite().
  1291.      
  1292.         BUGS
  1293.          Calling this function without an queued write request
  1294.          will hang up your process.
  1295.      
  1296.         SEE ALSO
  1297.          NCP_Write(), NCP_BeginWrite(), NCP_AbortWrite(), NCP_CheckWrite()
  1298.  
  1299. NCP_WriteSig
  1300. ------------
  1301.  
  1302.         NAME
  1303.          NCP_WriteSig -- return signal mask of channel write port.
  1304.      
  1305.         SYNOPSIS
  1306.          sigmask = NCP_WriteSig( channel )
  1307.            D0                     A0
  1308.      
  1309.          ULONG NCP_WriteSig( APTR );
  1310.      
  1311.         FUNCTION
  1312.          This function returns the signal mask of the write port
  1313.          of the given NCP channel. This signal is set if a write
  1314.          request completes.
  1315.      
  1316.         INPUTS
  1317.          channel -- a NCP channel created by NCP_OpenChannel()
  1318.      
  1319.         RESULT
  1320.          sigmask -- signal mask of write port.
  1321.      
  1322.         EXAMPLE
  1323.      
  1324.         NOTES
  1325.          Note that this function returns a signal mask, not a signal bit number.
  1326.      
  1327.         BUGS
  1328.      
  1329.         SEE ALSO
  1330.          NCP_BeginWrite()
  1331.  
  1332. NCP_Fault
  1333. ---------
  1334.  
  1335.         NAME
  1336.          NCP_Fault -- return localized NCP error string
  1337.      
  1338.         SYNOPSIS
  1339.          NCP_Fault( code, header, buffer, buffersize );
  1340.                     D0     A0      A1        D1
  1341.      
  1342.         void NCP_Fault( LONG, STRPTR, STRPTR, ULONG );
  1343.      
  1344.         FUNCTION
  1345.          Returns a localized text string associated with the
  1346.          error code.
  1347.      
  1348.         INPUTS
  1349.          code -- NCP error code
  1350.          header -- header to insert before string. May be NULL
  1351.          buffer -- buffer to write the error text to
  1352.          buffersize -- size of buffer
  1353.      
  1354.         RESULT
  1355.          None.
  1356.      
  1357.         EXAMPLE
  1358.      
  1359.         NOTES
  1360.      
  1361.         BUGS
  1362.          None known.
  1363.      
  1364.         SEE ALSO
  1365.          dos.library/Fault()
  1366.  
  1367. NCP_LinkRemoteRun
  1368. -----------------
  1369.  
  1370.         NAME
  1371.          NCP_LinkRemoteRun -- use the NCP link channel to run a program on
  1372.                               the remote machine.
  1373.      
  1374.         SYNOPSIS
  1375.          error = NCP_LinkRemoteRun( filename, cmdline, cmdlinelen )
  1376.          D0                            A0       A1        D0
  1377.      
  1378.         LONG NCP_LinkRemoteRun( STRPTR, APTR, ULONG );
  1379.      
  1380.         FUNCTION
  1381.          Use the LINK supervisor channel to have the remote link
  1382.          run a program. No NCP channel needs to be opened in order
  1383.          to perform this operation.
  1384.      
  1385.         INPUTS
  1386.          filename -- file name of the remote program to start
  1387.          cmdline -- pointer to command line array. Note that
  1388.                     EPOC command lines are *NOT* zero terminated.
  1389.          cmdlinelen -- length of command line in bytes. May be
  1390.                        zero, in which case no command line
  1391.                        is transfered.
  1392.      
  1393.         RESULT
  1394.          error -- either an AmigaNCP specific error code or the
  1395.                   result code from the remote link.
  1396.      
  1397.         EXAMPLE
  1398.          Have WORD.APP read the Amiga startup sequence:
  1399.      
  1400.             UBYTE cmdline[] = {
  1401.              "OANCPTest\000 V TES\000REM::SYS:\S\STARTUP-SEQUENCE\000"
  1402.             };
  1403.             error = NCP_LinkRemoteRun( "WORD.APP", cmdline, sizeof( cmdline ) );
  1404.      
  1405.         NOTES
  1406.          See the Psion SDK for more information about using commandlines and
  1407.          the LINK process launch feature.
  1408.      
  1409.         BUGS
  1410.          None known.
  1411.      
  1412.         SEE ALSO
  1413.  
  1414. NCP_clnl
  1415. --------
  1416.  
  1417.         NAME
  1418.          NCP_clnl -- clear CR/LF at end of line.
  1419.      
  1420.         SYNOPSIS
  1421.          NCP_clnl( string )
  1422.                    A0
  1423.      
  1424.          void NCP_clnl( STRPTR );
  1425.      
  1426.         FUNCTION
  1427.          Clears any CR or LF characters at the end of the string.
  1428.      
  1429.         INPUTS
  1430.          string -- pointer to string (contents will be modified)
  1431.      
  1432.         RESULT
  1433.          None.
  1434.      
  1435.         EXAMPLE
  1436.      
  1437.         NOTES
  1438.      
  1439.         BUGS
  1440.          None known.
  1441.      
  1442.         SEE ALSO
  1443.  
  1444. NCP_ibm2iso
  1445. -----------
  1446.  
  1447.         NAME
  1448.          NCP_ibm2iso -- convert IBM to ISO charachter
  1449.      
  1450.         SYNOPSIS
  1451.          isochar = NCP_ibm2iso( ibmchar )
  1452.            D0                    D0 0:7
  1453.      
  1454.          UBYTE NCP_ibm2iso( UBYTE );
  1455.      
  1456.         FUNCTION
  1457.          Converts a character from the IBM to the ISO charset.
  1458.      
  1459.         INPUTS
  1460.          ibmchar -- character of the IBM codeset
  1461.      
  1462.         RESULT
  1463.          isochar -- equivalent character in the ISO codeset
  1464.      
  1465.         EXAMPLE
  1466.      
  1467.         NOTES
  1468.      
  1469.         BUGS
  1470.          None known.
  1471.      
  1472.         SEE ALSO
  1473.  
  1474. NCP_iso2ibm
  1475. -----------
  1476.  
  1477.         NAME
  1478.          NCP_iso2ibm -- convert IBM to ISO charachter
  1479.      
  1480.         SYNOPSIS
  1481.          ibmchar = NCP_iso2ibm( isochar )
  1482.            D0                    D0 0:7
  1483.      
  1484.          UBYTE NCP_iso2ibm( UBYTE );
  1485.      
  1486.         FUNCTION
  1487.          Converts a character from the ISO to the IBM charset.
  1488.      
  1489.         INPUTS
  1490.          isochar -- character of the ISO codeset
  1491.      
  1492.         RESULT
  1493.          ibmchar -- equivalent character in the IBM codeset
  1494.      
  1495.         EXAMPLE
  1496.      
  1497.         NOTES
  1498.      
  1499.         BUGS
  1500.          None known.
  1501.      
  1502.         SEE ALSO
  1503.  
  1504. NCP_IWORD
  1505. ---------
  1506.  
  1507.         NAME
  1508.          NCP_IWORD -- swap bytes in word
  1509.      
  1510.         SYNOPSIS
  1511.          sword = NCP_IWORD( word )
  1512.            D0                D0
  1513.      
  1514.          UWORD NCP_IWORD( UWORD );
  1515.      
  1516.         FUNCTION
  1517.          Swaps the byte order within the word.
  1518.      
  1519.         INPUTS
  1520.          word -- a 16 bit data word.
  1521.      
  1522.         RESULT
  1523.          sword -- the same word with the byte order swapped.
  1524.      
  1525.         EXAMPLE
  1526.      
  1527.         NOTES
  1528.      
  1529.         BUGS
  1530.          None known.
  1531.      
  1532.         SEE ALSO
  1533.  
  1534. NCP_IWORDP
  1535. ----------
  1536.  
  1537.         NAME
  1538.          NCP_IWORDP -- swap bytes in word (pointer version)
  1539.      
  1540.         SYNOPSIS
  1541.          sword = NCP_IWORDP( wordp1, wordp2 )
  1542.            D0                  A0      A1
  1543.      
  1544.          UWORD NCP_IWORDP( UWORD *, UWORD * );
  1545.      
  1546.         FUNCTION
  1547.          Swaps the byte order from the word pointed to by wordp1
  1548.          and places the result in the word pointed to by wordp2.
  1549.      
  1550.         INPUTS
  1551.          wordp1 -- pointer to source word
  1552.          wordp2 -- pointer to destination word
  1553.      
  1554.         RESULT
  1555.          sword -- the same word with the byte order swapped.
  1556.      
  1557.         EXAMPLE
  1558.      
  1559.         NOTES
  1560.          The words don't need to be word aligned.
  1561.      
  1562.         BUGS
  1563.          The 68020++ version of amigancp.library requires the hardware
  1564.          to be able to do misaligned word accesses. Some early
  1565.          accelerator boards may have problems doing this.
  1566.      
  1567.         SEE ALSO
  1568.  
  1569. NCP_IWORDPI
  1570. -----------
  1571.  
  1572.         NAME
  1573.          NCP_IWORDPI -- swap bytes in word (in-place pointer version)
  1574.      
  1575.         SYNOPSIS
  1576.          sword = NCP_IWORDPI( wordp1 )
  1577.            D0                   A0
  1578.      
  1579.          UWORD NCP_IWORDP( UWORD * )
  1580.      
  1581.         FUNCTION
  1582.          Swaps the byte order within the word pointed to by wordp.
  1583.      
  1584.         INPUTS
  1585.          wordp -- pointer to word to swap
  1586.      
  1587.         RESULT
  1588.          sword -- the same word with the byte order swapped.
  1589.      
  1590.         EXAMPLE
  1591.      
  1592.         NOTES
  1593.          The word doesn't need to be word aligned.
  1594.      
  1595.         BUGS
  1596.          The 68020++ version of amigancp.library requires the hardware
  1597.          to be able to do misaligned word accesses. Some early
  1598.          accelerator boards may have problems doing this.
  1599.      
  1600.         SEE ALSO
  1601.  
  1602. NCP_ILONG
  1603. ---------
  1604.  
  1605.         NAME
  1606.          NCP_ILONG -- swap bytes in longword
  1607.      
  1608.         SYNOPSIS
  1609.          slongword = NCP_ILONG( longword )
  1610.            D0                     D0
  1611.      
  1612.          ULONG NCP_ILONG( ULONG );
  1613.      
  1614.         FUNCTION
  1615.          Swaps the byte order within the longword.
  1616.      
  1617.         INPUTS
  1618.          longword -- a 32 bit data word.
  1619.      
  1620.         RESULT
  1621.          slongword -- the same word with the byte order swapped.
  1622.      
  1623.         EXAMPLE
  1624.      
  1625.         NOTES
  1626.      
  1627.         BUGS
  1628.          None known.
  1629.      
  1630.         SEE ALSO
  1631.  
  1632. NCP_ILONGP
  1633. ----------
  1634.  
  1635.         NAME
  1636.          NCP_ILONGP -- swap bytes in longword (pointer version)
  1637.      
  1638.         SYNOPSIS
  1639.          sword = NCP_ILONGP( longwordp1, longwordp2 )
  1640.            D0                    A0          A1
  1641.      
  1642.          ULONG NCP_ILONGP( ULONG *, ULONG * );
  1643.      
  1644.         FUNCTION
  1645.          Swaps the byte order from the longword pointed to by longwordp1
  1646.          and places the result in the longword pointed to by longwordp2.
  1647.      
  1648.         INPUTS
  1649.          longwordp1 -- pointer to source longword
  1650.          longwordp2 -- pointer to destination longword
  1651.      
  1652.         RESULT
  1653.          sword -- the same word with the byte order swapped.
  1654.      
  1655.         EXAMPLE
  1656.      
  1657.         NOTES
  1658.          The longwords don't need to be word aligned.
  1659.      
  1660.         BUGS
  1661.          The 68020++ version of amigancp.library requires the hardware
  1662.          to be able to do misaligned word accesses. Some early
  1663.          accelerator boards may have problems doing this.
  1664.      
  1665.         SEE ALSO
  1666.  
  1667. NCP_ILONGPI
  1668. -----------
  1669.  
  1670.         NAME
  1671.          NCP_ILONGPI -- swap bytes in longword (in-place pointer version)
  1672.      
  1673.         SYNOPSIS
  1674.          sword = NCP_ILONGPI( longwordp )
  1675.            D0                    A0
  1676.      
  1677.          ULONG NCP_ILONGP( ULONG * )
  1678.      
  1679.         FUNCTION
  1680.          Swaps the byte order within the longword pointed to by longwordp.
  1681.      
  1682.         INPUTS
  1683.          longwordp -- pointer to longword to swap
  1684.      
  1685.         RESULT
  1686.          sword -- the same word with the byte order swapped.
  1687.      
  1688.         EXAMPLE
  1689.      
  1690.         NOTES
  1691.          The longword doesn't need to be word aligned.
  1692.      
  1693.         BUGS
  1694.          The 68020++ version of amigancp.library requires the hardware
  1695.          to be able to do misaligned word accesses. Some early
  1696.          accelerator boards may have problems doing this.
  1697.      
  1698.         SEE ALSO
  1699.  
  1700. Error codes from NCP functions
  1701. ==============================
  1702.  
  1703. Several amigancp.library functions may return negative error
  1704. numbers.  Note that besides the errors internal to
  1705. amigancp.library, standard EPOC OS errors may be returned by some
  1706. functions.
  1707.  
  1708. NCPE_INUSE (-1)
  1709.      There is already a read/write request pending on the given channel.
  1710.  
  1711. NCPE_ABORTED (-2)
  1712.      The read/write request has been aborted by NCP_AbortXXX()
  1713.  
  1714. NCPE_OFFLINE (-3)
  1715.      There is no NCP connection.  This may denote that the remote NCP
  1716.      closed the connection.
  1717.  
  1718. NCPE_INACTIVE (-4)
  1719.      The channel is currently inactive.  Most likely it has been closed
  1720.      by the remote process, or the NCP connection is currently dropped
  1721.      due to serial link failure.
  1722.  
  1723. NCPE_NOTFOUND (-5)
  1724.      You attempted to open an active channel and the remote process
  1725.      didn't exist.
  1726.  
  1727. NCPE_RECONNECTED (-6)
  1728.      This is not really an error.  Queued read requests will be
  1729.      terminated with this error value if the NCP connection has been
  1730.      succesfully reconnected.
  1731.  
  1732. NCPE_NEWUSER (-7)
  1733.      This is not really an error.  It may come up if the remote client
  1734.      of a passive channel changed.
  1735.  
  1736. Index
  1737. *****
  1738.  
  1739.  
  1740.  
  1741.  NCP.config                             Using AmigaNCP
  1742.  AmigaNCP File Server                   File Server
  1743.  AmigaNCP File System                   File System
  1744.  amigancp.library calls                 API
  1745.  amigancp.library functions             API
  1746.  API                                    API
  1747.  error codes                            Errors
  1748.  File Server options                    File Server
  1749.  File System Options                    File System
  1750.  function calls                         API
  1751.  Installation                           Using AmigaNCP
  1752.  Installing AmigaNCP                    Using AmigaNCP
  1753.  Introduction                           Introduction
  1754.  Monitor                                AmigaNCP-Monitor
  1755.  NCP errors                             Errors
  1756.  NCP-Monitor                            AmigaNCP-Monitor
  1757.  NCP_AbortRead                          NCP_AbortRead
  1758.  NCP_AbortWrite                         NCP_AbortWrite
  1759.  NCP_BeginRead                          NCP_BeginRead
  1760.  NCP_BeginWrite                         NCP_BeginWrite
  1761.  NCP_CheckRead                          NCP_CheckRead
  1762.  NCP_CheckWrite                         NCP_CheckWrite
  1763.  NCP_clnl                               NCP_clnl
  1764.  NCP_CloseChannel                       NCP_CloseChannel
  1765.  NCP_Fault                              NCP_Fault
  1766.  NCP_ibm2iso                            NCP_ibm2iso
  1767.  NCP_ILONG                              NCP_ILONG
  1768.  NCP_ILONGP                             NCP_ILONGP
  1769.  NCP_ILONGPI                            NCP_ILONGPI
  1770.  NCP_iso2ibm                            NCP_iso2ibm
  1771.  NCP_IWORD                              NCP_IWORD
  1772.  NCP_IWORDP                             NCP_IWORDP
  1773.  NCP_IWORDPI                            NCP_IWORDPI
  1774.  NCP_LinkRemoteRun                      NCP_LinkRemoteRun
  1775.  NCP_OpenChannel                        NCP_OpenChannel
  1776.  NCP_Read                               NCP_Read
  1777.  NCP_ReadSig                            NCP_ReadSig
  1778.  NCP_WaitRead                           NCP_WaitRead
  1779.  NCP_WaitWrite                          NCP_WaitWrite
  1780.  NCP_Write                              NCP_Write
  1781.  NCP_WriteSig                           NCP_WriteSig
  1782.  Network Monitor                        AmigaNCP-Monitor
  1783.  Options, File Server                   File Server
  1784.  Options, File System                   File System
  1785.  Other Tools                            Other Tools
  1786.  Parts                                  Introduction
  1787.  Remote File Server                     File Server
  1788.  Remote File System                     File System
  1789.  S3PrintServer                          S3PrintServer
  1790.  S3Run                                  S3Run
  1791.  serial configuration                   Using AmigaNCP
  1792.  serial.device, configuration of        Using AmigaNCP
  1793.  
  1794.